<%- bundle ||= in_place_edit_title_and_notes -%>
<script type="text/javascript" charset="utf-8">
//<![CDATA[
  $(function() {
    var path =  <%= bundle_path(bundle).to_json %>;
    var load_path = <%= edit_bundle_path(bundle).to_json %>;
    base_options = {
      submitdata: {"_method": "put"},
      cssclass  : "edit_in_place",
      submit    : "<%= escape_javascript image_tag("accept.png") %> Save",
      cancel    : "<%= escape_javascript image_tag("cross.png") %> Cancel",
      tooltip   : "Click to edit...",
      onblur    : "ignore"
    }
    $(".bundle_title").editable(path, $.extend({
      name    : "bundle[title]",
      cssclass: "edit_in_place edit_title"
    }, base_options));    
    $(".bundle_notes").editable(path, $.extend({
      name        : "bundle[notes]",
      type        : "textarea",
      rows        : 3,
      loadurl     : load_path + "?attribute=notes",
      cssclass    : "edit_in_place edit_notes",
      placeholder : '<span class="with_image notes_image">Add notes...</span>'
    }, base_options));    
  });
// ]]>
</script>